import Config from "../main.config";
import Ajax from "../utils/Ajax";
module.exports = {
    /*
    * 求职意向列表
    * */
    getList: async function (createUser) {
        let url = Config.api.jobIntentionList;
        let res = await Ajax.request({
            method: "POST",
            url,
            data: {createUser}
        })
        return res.map(function (item) {
            return {
                id: item.id,
                nature: item.nature,
                industryNo: item.industryNo,
                industryName: item.industryName,
                professionalNo: item.professionalNo,
                professionalName: item.professionalName,
                city: item.city,
                salary: item.salary
            }
        })
    },

    /*
    * 添加求职意向信息
    * */
    add: async function (data = {}) {
        let url = Config.api.jobIntentionAdd;
        return Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    edit: async function (data = {}) {
        let url = Config.api.jobIntentionEdit;
        return await Ajax.request({
            method: "POST",
            url,
            data: data
        })
    }
}